package com.chen.posp.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.chen.posp.enums.CurrencyType;
import com.chen.posp.enums.TrxProcessStatus;
import com.chen.posp.enums.TrxType;


/**
 * <p>
 * <b>Title:</b>POS机原始请求信息表
 * </p>
 * <p>
 * <b>Description:</b>
 * </p>
 * 
 * @version 1.0
 * @author jun.pang
 */

@Entity
@SequenceGenerator(name = "SEQ_STORE", sequenceName = "SEQ_POS_POSTRXREQUEST_ID")
@Table(name = "TBL_POS_POSTRXREQUEST")
public class PosTrxRequest{
	private static final long serialVersionUID = -8901901507961308096L;
	/**
	 * 卡号(Primary Account Number缩写)
	 */
	private String pan;

	/**
	 * 密文卡号 add by hongchao.li 2012-12-13
	 */
	private String secretPan;

	/**
	 * 交易类型
	 */
	private TrxType trxType;

	/**
	 * 交易处理状态
	 */
	private TrxProcessStatus trxProcessStatus;

	/**
	 * 交易金额
	 */
	private double trxAmount;

	/**
	 * POS流水号
	 */
	private String posRequestId;

	/**
	 * 网点商户号
	 */
	private String shopCustomerNumber;

	/**
	 * POS终端号
	 */
	private String posCATI;

	/**
	 * 输入方式
	 */
	private String inputType;

	/**
	 * POS刷卡时间 /交易完成时间/交易结束时间
	 */
	private Date posTrxTime;

	/**
	 * 订单接收时间
	 */
	private Date orderReceiveTime;

	/**
	 * CVV2
	 */
	private String cvv2;

	/**
	 * 币种(Currency Code Transaction)
	 */
	private CurrencyType currencyType;

	/**
	 * 交易批次号
	 */
	private String posBatch;

	/**
	 * 分期付款标志
	 */
	private String installmentsPayMark;

	/**
	 * 2磁道信息
	 */
	private String track2Data;

	/**
	 * 3磁道信息
	 */
	private String track3Data;

	/**
	 * 处理码
	 */
	private String processingCode;

	/**
	 * 服务代码
	 */
	private String serviceCode;

	/**
	 * 操作员
	 */
	private String posOperator;

	/**
	 * 系统流水号 （收单平台返回给POS机的文档参考号）
	 */
	private String externalId;

	/**
	 * 原始请求报文
	 */
	private String requesMessage;

	/**
	 * 个人识别码/密码
	 */
	private String pin;

	/**
	 * 原交易批次号
	 */
	private String sourcePosBatch;

	/**
	 * 原交易流水号
	 */
	private String sourcePosRequestId;

	/**
	 * 原交易日期MMDD
	 */
	private String sourceTrxDate;

	/**
	 * 来源（比如：订单查询，各种消费交易）
	 */
	private String trxSource;

	/**
	 * 拨号POS来电号码
	 */
	private String callPhoneNo;

	/**
	 * 拨号POS服务号码
	 */
	private String servicePhoneNo;

	/**
	 * 响应码
	 */
	private String responseCode;

	/**
	 * 位置区码 location area code
	 */
	private String LAC;

	/**
	 * 小区识别码 CELL ID
	 */
	private String CID;

	/**
	 * 卡号后4位 add by hongchao.li 2012-12-19
	 */
	private String panSuffix;

	@Transient
	public String getPan() {
		return pan;
	}

	public void setPan(String pan) {
		this.pan = pan;
	}

	@Column(name = "PAN", length = 100)
	public String getSecretPan() {
		return secretPan;
	}

	public void setSecretPan(String secretPan) {
		this.secretPan = secretPan;
	}

	@Column(name = "POS_CATI", length = 20)
	public String getPosCATI() {
		return posCATI;
	}

	public void setPosCATI(String posCATI) {
		this.posCATI = posCATI;
	}

	@Column(name = "PIN", length = 20)
	public String getPin() {
		return pin;
	}

	public void setPin(String pin) {
		this.pin = pin;
	}

	@Column(name = "EXTERNAL_ID", length = 20)
	public String getExternalId() {
		return externalId;
	}

	public void setExternalId(String externalId) {
		this.externalId = externalId;
	}

	@Column(name = "POS_REQUEST_ID", length = 20)
	public String getPosRequestId() {
		return posRequestId;
	}

	public void setPosRequestId(String posRequestId) {
		this.posRequestId = posRequestId;
	}

	@Column(name = "SOURCE_POS_REQUEST_ID", length = 20)
	public String getSourcePosRequestId() {
		return sourcePosRequestId;
	}

	public void setSourcePosRequestId(String sourcePosRequestId) {
		this.sourcePosRequestId = sourcePosRequestId;
	}

	@Column(name = "POS_BATCH", length = 20)
	public String getPosBatch() {
		return posBatch;
	}

	public void setPosBatch(String posBatch) {
		this.posBatch = posBatch;
	}

	@Column(name = "SOURCE_POS_BATCH", length = 20)
	public String getSourcePosBatch() {
		return sourcePosBatch;
	}

	public void setSourcePosBatch(String sourcePosBatch) {
		this.sourcePosBatch = sourcePosBatch;
	}

	@Enumerated(value = EnumType.STRING)
	@Column(name = "TRX_TYPE", columnDefinition = "VARCHAR(50)")
	public TrxType getTrxType() {
		return trxType;
	}

	public void setTrxType(TrxType trxType) {
		this.trxType = trxType;
	}

	@Enumerated(value = EnumType.STRING)
	@Column(name = "TRX_PROCESS_STATUS", columnDefinition = "VARCHAR(30)")
	public TrxProcessStatus getTrxProcessStatus() {
		return trxProcessStatus;
	}

	public void setTrxProcessStatus(TrxProcessStatus trxProcessStatus) {
		this.trxProcessStatus = trxProcessStatus;
	}

	@Column(name = "TRX_AMOUNT", columnDefinition = "decimal(14,2)")
	public double getTrxAmount() {
		return trxAmount;
	}

	public void setTrxAmount(double trxAmount) {
		this.trxAmount = trxAmount;
	}

	@Column(name = "SHOP_CUSTOMER_NUMBER", length = 20)
	public String getShopCustomerNumber() {
		return shopCustomerNumber;
	}

	public void setShopCustomerNumber(String shopCustomerNumber) {
		this.shopCustomerNumber = shopCustomerNumber;
	}

	@Column(name = "INPUT_TYPE", length = 20)
	public String getInputType() {
		return inputType;
	}

	public void setInputType(String inputType) {
		this.inputType = inputType;
	}

	@Column(name = "POS_TRX_TIME")
	public Date getPosTrxTime() {
		return posTrxTime;
	}

	public void setPosTrxTime(Date posTrxTime) {
		this.posTrxTime = posTrxTime;
	}

	@Column(name = "ORDER_RECEIVE_TIME")
	public Date getOrderReceiveTime() {
		return orderReceiveTime;
	}

	public void setOrderReceiveTime(Date orderReceiveTime) {
		this.orderReceiveTime = orderReceiveTime;
	}

	@Column(name = "SOURCE_TRX_DATE", length = 20)
	public String getSourceTrxDate() {
		return sourceTrxDate;
	}

	public void setSourceTrxDate(String sourceTrxDate) {
		this.sourceTrxDate = sourceTrxDate;
	}

	@Column(name = "CVV2", length = 20)
	public String getCvv2() {
		return cvv2;
	}

	public void setCvv2(String cvv2) {
		this.cvv2 = cvv2;
	}

	@Enumerated(value = EnumType.STRING)
	@Column(name = "CURRENCY_TYPE", columnDefinition = "VARCHAR(20)")
	public CurrencyType getCurrencyType() {
		return currencyType;
	}

	public void setCurrencyType(CurrencyType currencyType) {
		this.currencyType = currencyType;
	}

	@Column(name = "INSTALLMENTS_PAY_MARK", length = 20)
	public String getInstallmentsPayMark() {
		return installmentsPayMark;
	}

	public void setInstallmentsPayMark(String installmentsPayMark) {
		this.installmentsPayMark = installmentsPayMark;
	}

	@Column(name = "TRACK2_DATA", length = 200)
	public String getTrack2Data() {
		return track2Data;
	}

	public void setTrack2Data(String track2Data) {
		this.track2Data = track2Data;
	}

	@Column(name = "TRACK3_DATA", length = 200)
	public String getTrack3Data() {
		return track3Data;
	}

	public void setTrack3Data(String track3Data) {
		this.track3Data = track3Data;
	}

	@Column(name = "PROCESSING_CODE", length = 20)
	public String getProcessingCode() {
		return processingCode;
	}

	public void setProcessingCode(String processingCode) {
		this.processingCode = processingCode;
	}

	@Column(name = "SERVICE_CODE", length = 20)
	public String getServiceCode() {
		return serviceCode;
	}

	public void setServiceCode(String serviceCode) {
		this.serviceCode = serviceCode;
	}

	@Column(name = "POS_OPERATOR", length = 20)
	public String getPosOperator() {
		return posOperator;
	}

	public void setPosOperator(String posOperator) {
		this.posOperator = posOperator;
	}

	@Column(name = "REQUEST_MESSAGE", length = 1024)
	public String getRequesMessage() {
		return requesMessage;
	}

	public void setRequesMessage(String requesMessage) {
		this.requesMessage = requesMessage;
	}

	@Column(name = "TRX_SOURCE ", length = 20)
	public String getTrxSource() {
		return trxSource;
	}

	public void setTrxSource(String trxSource) {
		this.trxSource = trxSource;
	}

	@Column(name = "CALL_PHONE_NO", length = 50)
	public String getCallPhoneNo() {
		return callPhoneNo;
	}

	public void setCallPhoneNo(String callPhoneNo) {
		this.callPhoneNo = callPhoneNo;
	}

	@Column(name = "SERVICE_PHONE_NO", length = 50)
	public String getServicePhoneNo() {
		return servicePhoneNo;
	}

	public void setServicePhoneNo(String servicePhoneNo) {
		this.servicePhoneNo = servicePhoneNo;
	}

	@Column(name = "RESPONSE_CODE", length = 25)
	public String getResponseCode() {
		return responseCode;
	}

	public void setResponseCode(String responseCode) {
		this.responseCode = responseCode;
	}

	@Column(name = "LAC", length = 20)
	public String getLAC() {
		return LAC;
	}

	public void setLAC(String lAC) {
		LAC = lAC;
	}

	@Column(name = "CID", length = 20)
	public String getCID() {
		return CID;
	}

	public void setCID(String cID) {
		CID = cID;
	}

	@Column(name = "PAN_SUFFIX", length = 10)
	public String getPanSuffix() {
		return panSuffix;
	}

	public void setPanSuffix(String panSuffix) {
		this.panSuffix = panSuffix;
	}

}
